<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <input type="text" class="a">
    <br>
    <input type="text" class="b">
    <br>
    <button>注册</button>


    <script src="../js/tools.js"></script>
    <script src="../js/api_v2.js"></script>

    <script>

        $('button').onclick = async function () {  
            const username = $('.a').value ;
            const password = $('.b').value ;
            // 判断  。。。

            const res = await reg({
                username ,
                password 
            })

            console.log(res);

            const {status , msg} = res ;

            if(status) {
                location.href = './03login.html' ;
            } else {
                alert(msg)
            }



        }


    </script>
    
</body>
</html>